import { Avatar, Popover } from 'antd';

type Props = {
  url?: string;
};

const PopoverAvatar: React.FC<Props> = ({ url }) => {
  if (!url) {
    return null;
  }

  return (
    <Popover placement="right" content={<img width={300} height={300} src={url} />}>
      <Avatar src={url} />
    </Popover>
  );
};

export default PopoverAvatar;
